home *** CD-ROM | disk | FTP | other *** search
- #ifndef __PTROBJECT__
- #define __PTROBJECT__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __STDDEF__
- #include <stddef.h>
- #endif
-
- class PtrObject {
- public:
- static OSErr AllocHeap(size_t heapSize);
- // Create a heap heapSize bytes long to
- // allocate objects in.
-
- static void DisposeHeap();
- // Free up the heap allocated by a previous
- // call to AllocHeap.
-
- static long FreeMemory();
- // Return the total amount of free space in the heap.
-
- static Size MaxMemory();
-
- // Return the size of the largest free block in the heap.
-
- void* operator new(size_t size);
- void operator delete(void* p);
- // These are our special allocation and
- // deallocation operators.
-
- private:
- static THz fZone; // Our private zone pointer.
- };
-
- #endif
-